'use strict';
module.exports = {
	/**
	 * XXXnameXXX
	 * @url admin/system/user/sys/auth.js 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let {
			data = {}, userInfo, util, filterResponse, originalParam
		} = event;
		let {
			customUtil,
			uniID,
			config,
			pubFun,
			vk,
			db,
			_
		} = util;
		let {
			uid
		} = data;
		let res = {
			code: 0,
			msg: ''
		};
		// 业务逻辑开始-----------------------------------------------------------
		let {
			_id,
			realname_auth_status,
			fail_reason,
			auth_userid = uid
		} = data;

		// 参数合法校验结束-----------------------------------------------------------

		let dbName = "uni-id-users";

		let dataJson = {
			realname_auth_status,
			fail_reason,
			auth_userid
		};

		// 执行数据库API请求
		res.num = await vk.baseDao.updateById({
			dbName,
			id: _id,
			dataJson
		});

		return res;
	}
}